import { myRequest } from '@/utils/request';


export default new class Http {
  async get(url: string, params?: any, Options?: any): Promise<any> {
    let paramsed = {
      ...params
    }
    try {
      let res = await myRequest(url, { method: 'get', params: paramsed, ...Options });
      return res._value;
    } catch (error) {
      // 这里可以添加错误处理逻辑
      throw error;
    }
  }

  async post(url: string, params?: any, Options?: any): Promise<any> {
    let paramsed = {
      ...params
    }
    try {
      let res = await myRequest(url, { method: 'post', body: paramsed, ...Options });
      return res._value
    } catch (error) {
      // 这里可以添加错误处理逻辑
      throw error;
    }
  }
}